<?
$page_title="Manage Sevadhari - Requests ";
$mindex=3;
$profile_menu=1;
$req_id=$_GET["req_id"];
?>
<?include("includes/header.php") ?>
<?
$req_info=@array_pop(qry_data("select *,R.other_info as req_other_info from bkitc_seva_request R JOIN bkitc_profiles P where R.member_id=P.registrant_id and R.request_id=".$req_id));

if($_POST){
$member=getMemberInfo($req_info["registrant_id"]);
$stateval=$_REQUEST["hreqstate"];

exec_qry("UPDATE bkitc_seva_request set approval_status=$stateval where request_id=$req_id");
writeLog($member["full_name"]."'s Seva Request was updated by Admin : ".$_SESSION["admin_username"]);

if($_REQUEST["mem_notify"]==1){

$member["email_info"]=$_REQUEST["email_info"];
$member["app_status"]=$stateval;
notifySevareqStatus($member);

}


}


?>
<div class="fleft">
<ul class="subMenu">
<li><a href="seva_req_list.php">Back to List</a></li>

</ul>
</div>
<div class="cleardiv"></div>
<div class="break"></div>

<script src="calendarDateInput.js" language="javascript"></script>
<div class="break"></div>
<form method="post" action="view_sevarequest.php?req_id=<?=$_GET["req_id"]?>"  id="frmSevaReq" name="frmSevaReq"  >
<div class="note fright">* <i>Fields are readonly</i></div>
<table class="sevarequest" cellpadding="4" cellspacing="6" >

<tr>
<td class="frmLabel">Requested Member : </td>
<td ><span class="frmLabel"><?=$req_info["full_name"]?></span>&nbsp;[<?=$req_info["email_id"]?>] <a target="_blank" title="click to view details of this member" href="edit_member.php?mode=edit&mid=<?=$req_info["member_id"]?>"><b><?=formatMemberCode($req_info["member_id"])?></b></a></td>
</tr>
<tr>
<td class="frmLabel">Request Status : </td>
<td class="highlightg"><?=$seva_req_status[$req_info["approval_status"]]?></td>
</tr>

<tr>
<td class="frmLabel">Seva Location : </td>
<td class="frmLabel"><?=$seva_location[$req_info["seva_location"]]?></td>
</tr>

<? if($req_info["seva_location"]==0) { ?>
<tr>
<td class="frmLabel">From Date </td>

<td><?=$req_info["from_date"]?></td>
</tr>
<tr>
<td class="frmLabel">To Date </td>
<td>
<?=$req_info["to_date"]?>
</td>
</tr>
<? } ?>
<? if($req_info["seva_location"]==1) { ?>

<tr>
<td></td>
<td class="frmLabel"><b>Week Days</b></td>
<td class="frmLabel"><b>Week Ends</b></td>
</tr>
<tr>
<td class="frmLabel"><b>Best Time</b> *</td>
<td class="frmLabel"><input type="text" size="20" class="txtbox" name="week_days_time" readonly="true" value="<?=$req_info["week_days_time"]?>"></td>
<td class="frmLabel"><input type="text" size="20" class="txtbox" name="week_ends_time" readonly="true" value="<?=$req_info["week_ends_time"]?>"></td>
</tr>
<? } ?>
<tr>
<td colspan="3" class="frmLabel"><b>Other Information given by Sevadhari</b> *<br/>
<textarea class="txtarea" cols="90" rows="10" name="other_info" readonly="true"><?=$req_info["req_other_info"]?></textarea>

</td>

</tr>

<tr>
<td colspan="3" class="frmLabel"><input type="checkbox"   id="mem_notify" name="mem_notify" value="1" onclick="$('frmSevaReq').email_info.toggle();"><label for="mem_notify">Email Member with Message </label><br/>
<textarea class="txtarea" cols="90" rows="10" name="email_info" style="display:none" ></textarea>
</td>

</tr>

<tr>

<td colspan="3" align="right">
<p ><input value=" Accept & Approve Request "  type="submit" class="button" onclick="frmSevaReq.hreqstate.value=1"/> 	
<input value=" Put on Hold "  type="submit" class="button" onclick="frmSevaReq.hreqstate.value=2"/> 	
<input type="hidden" name="hreqstate"  value="0">
<input type="button" value="Cancel" class="button" onclick="javascript:history.back()"/></p>

</td>
</tr>
</table>


</form>

<script type="txt/javascript">
function validateForm(vForm,vMode){




}

</script>
<?include("includes/footer.php") ?>